<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\goods\GoodsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '商品回收站';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="goods-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php //echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'name',
            //'category_id',
            //'goods_type',
            //'brand_id',
            // 'img',
            //'is_on_sale',
            // 'is_del',
            // 'add_time:datetime',
            // 'last_update',
            // 'remark',
            // 'supplier_id',
            // 'pack_unit',
            // 'class_id',
            // 'price_retail',
            // 'price_mix',
            // 'price_pack',
            // 'is_stock_disable',
            // 'is_auto_sale_on',
            // 'is_auto_sale_off',
            // 'stock',

            [
                'class' => 'yii\grid\ActionColumn',
                'template' => '{view} {update} {delete} {undelete}',
                'buttons'=>[
                    'view' ,
                    'update' => function ($url, $model, $key) {
                        return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['/supplier/goods/default/update','id'=>$model->id]);
                    },
                    'delete',
                    'undelete' => function ($url, $model, $key) {
                        return Html::a('<span class="glyphicon glyphicon-repeat" title="还原商品"></span>', ['undelete','id'=>$model->id]);
                    },
                ],
            ],
        ],
    ]); ?>

</div>
